<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" onclick="on()" value="开灯">
<img id="myIMage" border="0" src="../imgs/off.gif" style="text-align: center">
<input type="button" onclick="off()" value="关灯">
<script>
    function on(){
        document.getElementById('myIMage').src='../imgs/on.gif';
    }
    function off(){
        document.getElementById('myIMage').src='../imgs/off.gif';
    }
    document.getElementById("myIMage").onmouseover

</script>

</body>
</html>